home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tegl6b.zip / INTROPAK.EXE / lha / TEGLMAIN.DOC < prev    next >
Text File  |  1991-08-16  |  11KB  |  303 lines

  1. {-----------------------------------------------------------------------------}
  2. {               TEGL Windows ToolKit II                  }
  3. {          Copyright (C) 1990, 1991 TEGL Systems Corporation              }
  4. {                All Rights Reserved.                  }
  5. {-----------------------------------------------------------------------------}
  6. {$I switches.inc}
  7.  
  8. unit TEGLMain;
  9.  
  10. INTERFACE
  11.  
  12. USES
  13.   crt,
  14.   errorlog,
  15.   videochk,
  16.   virtmem,
  17.   ipstacks,
  18.   teglintr,
  19.   tgi,
  20.   fastgrph,
  21.   teglfont,
  22.   teglunit,
  23.   TEGLIcon,             {large button}
  24.  
  25.  
  26. {$IFDEF Quick}
  27.   TGraph;
  28. {$ELSE}
  29.   {$IFDEF NoGr}
  30.   TGraph;
  31.   {$ELSE}
  32.   Graph;
  33.   {$ENDIF}
  34. {$ENDIF}
  35.  
  36. Type
  37.     TEGLConstants = Record
  38.                TEGLBackColor         : Word;
  39.                TEGLBorderColor         : Word;
  40.                TEGLBackPattern         : FillPatternType;
  41.                TEGLBorderShow         : Boolean;
  42.                TEGLUserPattern         : Boolean;
  43.                TEGLFillStyle         : Word;
  44.  
  45.                ShadowColor         : Word;
  46.                ShadowBorderColor     : Word;
  47.                ShadowFillPattern     : FillPatternType;
  48.                ShadowUserPattern     : Boolean;
  49.                ShadowFillStyle         : Word;
  50.  
  51.                ShadowTextType         : Pointer;
  52.                DefaultTextHighlight  : Boolean;
  53.                DefaultTextHColor     : Word;
  54.                DefaultTextSColor     : Word;
  55.                ShadowTextMode         : Boolean;
  56.  
  57.                ExtendTextHColor      : Word;
  58.                ExtendTextSColor      : Word;
  59.                ExtendTextColor         : Word;
  60.  
  61.                ShiftTextColor         : Word;
  62.                ShiftTextSColor         : Word;
  63.  
  64.                ZipDuration         : Word;
  65.             end;
  66.  
  67.  
  68. CONST
  69.   EnableControlBreak : Boolean = TRUE;
  70.   StandardFont         : pointer = NIL;
  71.   beepstatus         : Boolean = TRUE;
  72.   BeepDivisor         : Word    = 1;
  73.   PressButtonFlag    : Boolean = TRUE;          {allows visual button press}
  74.  
  75.    {11111111  $FF
  76.     10001000  $88
  77.     10001000  $88
  78.     10001000  $88
  79.     11111111  $FF
  80.     10001000  $88
  81.     10001000  $88
  82.     10001000  $88}
  83.  
  84.     gridfill : FillPatternType = ($FF, $88, $88, $88, $FF, $88, $88, $88);
  85.  
  86.   BWTranslateTable : array[0..15] of byte =
  87.           ($00,         {Black      }
  88.            $00,         {Blue      }
  89.            $00,         {Green      }
  90.            $00,         {Cyan      }
  91.            $00,         {Red      }
  92.            $00,         {Magenta      }
  93.            $00,         {Brown      }
  94.            $ff,         {LightGray   }
  95.            $00,         {DarkGray      }
  96.            $ff,         {LightBlue   }
  97.            $ff,         {LightGreen  }
  98.            $ff,         {LightCyan   }
  99.            $00,         {LightRed      }
  100.            $ff,         {LightMagenta}
  101.            $aa,         {Yellow      }
  102.            $ff);         {White      }
  103.  
  104.   C256TranslateTable : array[0..255] of byte =
  105.           (
  106.            0,1,2,3,4,5,200,7,56,57,58,59,60,61,62,63,
  107.            $10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$1A,$1B,$1C,$1D,$1E,$1F,
  108.            $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2A,$2B,$2C,$2D,$2E,$2F,
  109.            $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3A,$3B,$3C,$3D,$3E,$3F,
  110.            $40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$4A,$4B,$4C,$4D,$4E,$4F,
  111.            $50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$5A,$5B,$5C,$5D,$5E,$5F,
  112.            $60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$6A,$6B,$6C,$6D,$6E,$6F,
  113.            $70,$71,$72,$73,$74,$75,$76,$77,$78,$79,$7A,$7B,$7C,$7D,$7E,$7F,
  114.            $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8A,$8B,$8C,$8D,$8E,$8F,
  115.            $90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$9A,$9B,$9C,$9D,$9E,$9F,
  116.            $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7,$A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF,
  117.            $B0,$B1,$B2,$B3,$B4,$B5,$B6,$B7,$B8,$B9,$BA,$BB,$BC,$BD,$BE,$BF,
  118.            $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7,$C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF,
  119.            $D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7,$D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF,
  120.            $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7,$E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF,
  121.            $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7,$F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF
  122.           );
  123.  
  124. {*------------------------------------------------------------------------*
  125.  |  TEGL Graphic constants                          |
  126.  *------------------------------------------------------------------------*}
  127.    TG             : TEGLConstants =
  128.                (TEGLBackColor      : white;
  129.                 TEGLBorderColor      : white;
  130.                 TEGLBackPattern      : ($AA,$55,$AA,$55,$AA,$55,$AA,$55);
  131.                 TEGLBorderShow      : TRUE;
  132.                 TEGLUserPattern      : TRUE;
  133.                 TEGLFillStyle      : Solidfill;
  134.  
  135.                 ShadowColor       : white;
  136.                 ShadowBorderColor      : black;
  137.                 ShadowFillPattern      : ($AA,$55,$AA,$55,$AA,$55,$AA,$55);
  138.                 ShadowUserPattern      : FALSE;
  139.                 ShadowFillStyle      : Solidfill;
  140.  
  141.                 ShadowTextType      : NIL;
  142.                 DefaultTextHighlight  : FALSE;
  143.                 DefaultTextHColor      : White;
  144.                 DefaultTextSColor      : Black;
  145.                 ShadowTextMode      : TRUE;
  146.  
  147.                 ExtendTextHColor      : Black;
  148.                 ExtendTextSColor      : LightGray;
  149.                 ExtendTextColor      : White;
  150.  
  151.                 ShiftTextColor      : White;
  152.                 ShiftTextSColor      : Black;
  153.  
  154.                 ZipDuration       : 18
  155.                );
  156.  
  157.    HERC_TG         : TEGLConstants =
  158.                {$IFDEF NoGr}
  159.                (TEGLBackColor      : white;
  160.                {$ELSE}
  161.                (TEGLBackColor      : black;
  162.                {$ENDIF}
  163.                 TEGLBorderColor      : white;
  164.                 TEGLBackPattern      : ($AA,$55,$AA,$55,$AA,$55,$AA,$55);
  165.                 TEGLBorderShow      : TRUE;
  166.                 TEGLUserPattern      : TRUE;
  167.                 TEGLFillStyle      : Solidfill;
  168.  
  169.                 ShadowColor       : white;
  170.                 ShadowBorderColor      : black;
  171.                 ShadowFillPattern      : ($AA,$55,$AA,$55,$AA,$55,$AA,$55);
  172.                 ShadowUserPattern      : FALSE;
  173.                 ShadowFillStyle      : Solidfill;
  174.  
  175.                 ShadowTextType      : NIL;
  176.                 DefaultTextHighlight  : FALSE;
  177.                 DefaultTextHColor      : White;
  178.                 DefaultTextSColor      : Black;
  179.                 ShadowTextMode      : TRUE;
  180.  
  181.                 ExtendTextHColor      : Black;
  182.                 ExtendTextSColor      : White;
  183.                 ExtendTextColor      : Black;
  184.  
  185.                 ShiftTextColor      : White;
  186.                 ShiftTextSColor      : Black;
  187.  
  188.                 ZipDuration       : 25
  189.                );
  190.  
  191. {*------------------------------------------------------------------------*
  192.  |  Integrated TEGL Easy Module                       |
  193.  *------------------------------------------------------------------------*}
  194.  
  195. Procedure ActiveButton(x,y: Word; s : String; p : CallProc);
  196. Function  ColToX(Col : Integer) : Integer;
  197. Procedure ErrMess(x,y : Word; S : String);
  198. Procedure FitFrame(VAR x,y,width,height : Word);
  199. Procedure FrameFromIcon(ifs: ImageStkPtr; ms : MsClickPtr; x,y,x1,y1: Word);
  200. Procedure FrameText(VAR ifs : ImageStkPtr; Row,Col: Integer; s : String);
  201. Function  GetMousey(ifs : ImageStkPtr): Word;
  202. Function  GetYesNo(x,y : Word; S : String): Boolean;
  203. Procedure EasyTEGL;
  204. Procedure EasyOut;
  205. Function  Quit(Frame:ImageStkPtr; MouseClickPos: MsClickPtr):Word;
  206. Procedure QuickFrame(VAR ifs : ImageStkPtr; x,y,width,height : Word);
  207. Procedure OutFrameTextXY(ifs : ImageStkPtr; x,y : Word; s : String);
  208. Procedure RestoreText;
  209. Function  RowToY(Row : Integer) : Integer;
  210. Procedure SelectEasyText;
  211. Procedure SetEasyFont(p : Pointer);
  212.  
  213. {*------------------------------------------------------------------------*
  214.  |  Shadowed Box routines                          |
  215.  *------------------------------------------------------------------------*}
  216. Procedure SetShadowColor(bcolor:Word);
  217. Procedure SetShadowBorderColor(bcolor:Word);
  218. Procedure SetShadowFillPattern(backpattern:FillPatternType);
  219. Procedure SetShadowFillStyle(pattern:Word);
  220. Procedure ShadowBox(x,y,x1,y1 : Word);
  221. Procedure ShadowText(x,y,Color:Word; textstr:String);
  222. Procedure SetShadowTextType(texttype:Pointer);
  223. Procedure SetShadowTextShadow(Color:Word);
  224. Procedure SetShadowTextHighlight(Color:Word);
  225. Procedure ShadowTextHighlightOFF;
  226. Procedure SetShadowTextMode(ModeOnOff:boolean);
  227. Procedure ShadowBoxText(x,y,txtlen:Word; textstr:String);
  228. Procedure SetExtendTextHighlight(Color:word);
  229. Procedure SetExtendTextShadow(Color:word);
  230. Procedure SetExtendTextColor(Color:word);
  231. Procedure ExtendTextXY(x,y:Word; msg:String);
  232. Procedure ShiftTextXY(x,y:Word; msg:String);
  233.  
  234. {*------------------------------------------------------------------------*
  235.  |  TEGL Initialization routines                      |
  236.  *------------------------------------------------------------------------*}
  237. Procedure SetTEGLBorderShow(BorderShow:Boolean);
  238. Procedure SetTEGLBackColor(BackColor:Word);
  239. Procedure SetTEGLBorderColor(BorderColor:Word);
  240. Procedure SetTEGLFillPattern(backpattern:FillPatternType);
  241. Procedure SetTEGLFillStyle(pattern:Word);
  242. Procedure ClearTEGLScreen;
  243.  
  244. {*------------------------------------------------------------------------*
  245.  |  Xorbox routines                              |
  246.  *------------------------------------------------------------------------*}
  247. Procedure MoveBox(ax,ay,x,y,x1,y1 : Integer);
  248. Procedure ZipToBox(ax,ay,ax1,ay1,x,y,x1,y1 : Integer);
  249. Procedure ZipFromBox(ax,ay,ax1,ay1,x,y,x1,y1 : Integer);
  250.  
  251. {*------------------------------------------------------------------------*
  252.  |  Explode and collapse                          |
  253.  *------------------------------------------------------------------------*}
  254. Procedure ExplodeFromIconHide(Frame:ImageStkPtr; MouseClickPos: MsClickPtr; x,y,x1,y1:Word);
  255. Procedure ExplodeFromMsClick(Frame:ImageStkPtr; MouseClickPos: MsClickPtr; x,y,x1,y1:Word);
  256. Function  CollapseToMsClick(fs:ImageStkPtr; MouseClickPos: MsClickPtr):Word;
  257. Function  CollapseToIconShow(fs:ImageStkPtr; MouseClickPos: MsClickPtr):Word;
  258.  
  259. {*------------------------------------------------------------------------*
  260.  |  Misc                                  |
  261.  *------------------------------------------------------------------------*}
  262. Procedure PressButton(fs:ImageStkPtr; ms:MsClickPtr);
  263. Procedure ReleaseButton(fs:ImageStkPtr; ms:MsClickPtr);
  264. Function  VisualButtonPress(fs:ImageStkPtr; ms:MsClickPtr) : Boolean;
  265. Function  CheckForMouseSelect(Frame:ImageStkPtr):MsClickPtr;
  266.  
  267. Procedure PressSquareButton(fs:ImageStkPtr; ms:MsClickPtr);
  268. Procedure ReleaseSquareButton(fs:ImageStkPtr; ms:MsClickPtr);
  269. Function  VisualSquareButtonPress(fs:ImageStkPtr; ms:MsClickPtr) : Boolean;
  270. Procedure DrawSquareButton(x1,y1,x2,y2:Word);
  271. Procedure DefineSquareButtonClick(fs:ImageStkPtr; x,y,x1,y1,rx,ry:Word; button:Pointer; EntryCallProc:callproc);
  272. Procedure ShiftText(x,y,c,s:Word; msg:String);
  273. Procedure DefineSquareButtonText(fs:ImageStkPtr; x,y,x1,y1,rx,ry:Word; msg:string; EntryCallProc:callproc);
  274. Procedure BevelBox(x,y,x1,y1,topcolor,botcolor,interior,thickness : Word);
  275. Procedure BevelBoxfs(fs:imagestkptr; x,y,x1,y1,topcolor,botcolor,interior,thickness : Word);
  276.  
  277. Procedure DrawLongButton(x,y,ln : Word);
  278. Procedure PutUserButtonClick(fs:ImageStkPtr; x,y:Word; msg:String);
  279. Procedure DefineButtonClick(fs:ImageStkPtr; x,y:Word; button:Pointer; EntryCallProc:callproc);
  280. Procedure DefineLongButtonClick(fs:ImageStkPtr; x,y,ln : Word; msg:String; EntryCallProc:callproc);
  281. Procedure DefineUserButtonClick(fs:ImageStkPtr; x,y:Word; msg:String; EntryCallProc:callproc);
  282.  
  283. Procedure Beep(tone,n,duration:Integer);
  284. Procedure SlideBeep(tone1,tone2,n:Integer);
  285. Procedure SoundSwitch(OnOff:Boolean);
  286.  
  287. Procedure FlipAPage;
  288. Procedure FlipVPage;
  289. Procedure SetAPage(pagenum:Word);
  290. Procedure SetVPage(pagenum:Word);
  291. Function  VideoPage : byte;
  292.  
  293. Procedure OutTEGLTextXY(x,y : Integer; mystr : String);
  294.  
  295. Function  CRClickPress : Boolean;
  296. Function  CRClickRelease : Boolean;
  297.  
  298. procedure TEGLInit(videomodename:string; hugeminimum:longint);
  299. Procedure TEGLSupervisor;
  300.  
  301.  
  302. IMPLEMENTATION
  303.